//
//  Utils.h
//  douniu
//
//  Created by dev on 2023/2/8.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class TTGTextTag;

@interface Utils : NSObject

/// 判断用户是否登录
+ (BOOL)isLogin;

/// 判断用户是否是 VIP
+ (BOOL)isVip;

/// 存储数据到本地
+ (void)setLocalStorage:(NSString *)key value:(id)value;

/// 获取本地存储数据
+ (id)getLocalStorage:(NSString *)key;

/// 获取用户数据
+ (NSDictionary *)getUserData;

/// 设置用户数据
+ (void)setUserData:(NSDictionary *)userData;

/// 设置用户 TOKEN
+ (void)setUserToken:(NSString *)userToken;

/// 获取用户 TOKEN
+ (NSString *)getUserToken;

/// 移除用户数据(包括登录凭证)
+ (void)removeUserData;

+ (NSString*)getImageUrl:(NSString*)imageUrl;

+ (NSString*)getFullVersionName;

+ (TTGTextTag*)generateTag:(NSString*)tagString tagType:(NSString*)tagType;

+ (NSString*)formatCoin:(NSInteger)coin;

+ (NSString*)formatDate:(NSString*)dateTime;

+ (NSString*)formatDate:(NSString*)dateTime format:(NSString*)format;

+ (NSString*)formatRemainDate:(NSString*)dateTime;

+ (NSInteger)formatRemainInterval:(NSString *)dateTime duration:(NSString*)duration;

+ (NSString*)formatDayOfWeek:(NSString*)dateTime;

+ (NSString*)formatTimestamp:(NSInteger)timestamp format:(NSString*)format;


@end

NS_ASSUME_NONNULL_END
